An electronic device, such as a smart key of a car, usually has a key provided thereon. The electronic device includes a housing and a printed circuit board (PCB) received in the housing. The key can be depressed by application of force from outside of the housing.